package com.itheima.health.exception;


import com.itheima.health.entity.Result;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
@Slf4j
public class ProjectExceptionAdvice {

    @ExceptionHandler
    public Result exx(RuntimeException ex){
       log.info("Result出现了RuntimeException异常");
       ex.printStackTrace();
       return new Result(false,"系统繁忙,请稍后重试",null);

    }

    @ExceptionHandler
    public Result exx1(Exception ex){
        log.info("PageResult出现了Exception异常");
        ex.printStackTrace();
        return new Result(false,"系统繁忙,请稍后重试",null);

    }
}
